<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script type="text/javascript">
    /*<![CDATA[*/
    function postData() {
        $.ajax({
        	type:"get",
            dataType:"json",
            url : '/api/postData',
            success : function(r) {
                console.log(r);
                alert(r.msg);
            },
            error : function() {
                alert('error!')
            }
        });
    };
    function postData1() {
        $.ajax({
        	type:"post",
            dataType:"json",
            url : '/user/all',
            success : function(r) {
                console.log(r);
                alert(r.total);
            },
            error : function() {
                alert('error!')
            }
        });
    }
    function postData2() {
        $.ajax({
            type:"post",
            dataType:"json",
            url : '/user/all',
            success : function(r) {
                console.log(r);
                alert(r);
            },
            error : function() {
                alert('error!')
            }
        });
    }
    $.ready(postData2());
    /*]]>*/
</script>
</head>

<body>
hello 123456789
    <div class="container">
    	<h2 th:text="${msg}"></h2>
    	<h2 th:text="${msg1}"></h2>
    </div>
</body>
</html>